TestLib is a MPW tool which has been built to test the AppleTalk "libraries"
that I have developed :
- Zone Information Protocol (ZIP.c)
- Name Binding Protocol (NBP.c)
- AppleTalk Filing Protocol (AFP.c)
These "librairies" can be used to implement AppleTalk functions. They have been tested but they probably contain errors, please inform me through AppleLink (BUTTIN) in order for me to maintain them.
This MPW tool :
- displays an AppleShare server time
- lists all the directories of an AppleShare volume with their access rights.
The Login on the server is done as guest or with username/password.
Using TestLib :
- Zone names are displayed
- Enter a zone name if any and validate your answer by the Enter key
- Server names are displayed
- Enter a server name and validate your answer by the Enter key
- Logging as guest is completed
- Server time as well as volume names are displayed
- Enter a volume name and validate your answer by the Enter key
- Volume access rights are displayed in guest mode
- For each directory accessible as guest, access rights are displayed
AppleTalk libraries :
These libraries contain highlevel calls to be used to build an application. All the AppleTalk calls are issued synchronously.
The AFP library shows how to use AFP calls to query a server (you need to refer to Inside AppleTalk to get the documentation about AFP calls).
The general philosophy is to issue a call providing a buffer to receive the results then to call a utility to extract the information from the buffer previously set.
Example : NBPGetList(buffer) to get all the entities in the buffer
NBPGetAddress(buffer,address) to extract an AppleTalk address from the buffer
Warning about "permanent" memory :
When you register a NBP entity, you must provide a buffer which must be available as long as the entity has not been removed.
When you open an AFP session, you must provide a SCBBlock which must be available as long as the session has not been closed.
NBP : contains all the Name Binding Protocol functions
InitNBP Open the .MPP driver;Turn SelfSend mode on/off
CloseNBP Turn SelfSend mode on/off
SetSelfSend Turn SelfSend mode on/off
NBPGetList Get the list of entities with a specific entity name
NBPGetAddress Extract the AppleTalk address of an entity
NBPRegisterEntity Create an entry in the Name Binding Table
NBPRemoveEntity Remove an entity from the Name Binding Table
ZIP : contains all the Zone Information Protocol functions (for Phase 1 and Phase 2)
GetZones Get the zones list
GetZoneName Extract a zone name from the zones list
InitXPP Open the .XPP driver
XPPGetZoneList Get the zones list using Phase 2 calls
InitATP Open the .ATP driver
ATPGetZoneList Get the zones list using Phase 1 calls
AFP : contains AppleTalk Filing Protocol functions and utilities to extract information
InitXPP Open the .ATP and .XPP drivers
GetServerInfo Get information about the server (name, UAMs, machine type)
LogOnwithName Open a session with username/password (no encryption of the password)
LogOnAsGuest Open a session in guest mode on an AppleShare server
GetServerParams Get Server Information (Time and volumes)
OpenVolume Open an AppleShare volume
GetVolumePrivileges Get volume privileges.
GetDirectories Get the subdirectories of a directory
CloseVolume Close an AppleShare volume
LogOut Stop the session
Utilities :
CheckUAM Check if a User Access Method is available
GetServerTime Calculate the server time in seconds (from 1 January 1904)
GetNumberVolumes Get the number of volumes of the server
ExtractVolumeName Get a volume name
GetNumberDirs Get the number of subdirectories of a directory
ExtractDirInfo Extract info regarding a subdirectory : name, dirID, access rights